<?php
class Zend_View_Helper_DataGridActionOptions extends Zend_View_Helper_Abstract
{
	/**
	 *
	 * @param array $options
	 */
	public function dataGridActionOptions(Array $options,$dataId) {
		$baseAsset = Zend_Controller_Front::getInstance()->getBaseUrl().'/public/assets/';

		$allActions = array('view','update','delete','print');
		$allowedActions = array_intersect($allActions,$options);
		$finalOptions = null;

		foreach($allActions as $option) {
			if(in_array($option,$allowedActions)) {
				$finalOptions .= '<a href="'.$option.'/id/'.(int)$dataId.'"><img src="'.$baseAsset.'/img/layout/icons/action_small_'.$option.'.png" alt="'.$option.'" border=0"/></a>';
			} else {
				$finalOptions .= '<img src="'.$baseAsset.'/img/layout/icons/action_small_'.$option.'_disabled.png" alt="'.$option.'" border=0"/>';
			}	
		}
		
		return $finalOptions;

	}
}